<?php
namespace app\admin\controller;

use app\BaseController;
use app\model\GoodsCategory;
use think\App;


class Goods extends BaseController{
    /**
     * 获取商品分类列表
     */
    public function  goods_category_list(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $GoodsCategory =  new GoodsCategory();
        $result = $GoodsCategory->goodsCategoryList($param);
        return $result;
    }

    /**
     * 新增编辑商品分类
     */
    public function  add_edit_cate(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $GoodsCategory =  new GoodsCategory();
        $result = $GoodsCategory->addEditCate($param);
        return $result;
    }

    /**
     * 删除商品分类
     */
    public function  del_goods_cate(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $GoodsCategory =  new GoodsCategory();
        $result = $GoodsCategory->delGoodsCate($param);
        return $result;
    }

    /**
     * 是否启用商品分类
     */
    public function  enable_goods_cate(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $GoodsCategory =  new GoodsCategory();
        $result = $GoodsCategory->enableGoodsCate($param);
        return $result;
    }

    /**
     * 获取商品列表
     */
    public function  goods_list(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $Goods =  new \app\model\Goods();
        $result = $Goods->goodsList($param);
        return $result;
    }

    /**
     * 新增编辑商品
     */
    public function  add_edit_goods(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $Goods =  new \app\model\Goods();
        $result = $Goods->addEditGoods($param);
        return $result;
    }

    /**
     * 删除商品
     */
    public function  del_goods(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $Goods =  new \app\model\Goods();
        $result = $Goods->delGoods($param);
        return $result;
    }

    /**
     * 获取商品详情
     */
    public function  goods_detail(){
        $admin_id = $this->app->make('admin_id');
        $param  =  request()->param();
        $param['admin_id'] = $admin_id;
        $Goods =  new \app\model\Goods();
        $result = $Goods->goodsDetail($param);
        return $result;
    }





}
